package com.cskaoyan.market.admin.service.impl;

import com.cskaoyan.market.admin.service.MarketDashBoardService;
import com.cskaoyan.market.db.domain.MarketGoodsExample;
import com.cskaoyan.market.db.domain.MarketGoodsProductExample;
import com.cskaoyan.market.db.domain.MarketOrderExample;
import com.cskaoyan.market.db.domain.MarketUserExample;
import com.cskaoyan.market.db.mapper.MarketGoodsMapper;
import com.cskaoyan.market.db.mapper.MarketGoodsProductMapper;
import com.cskaoyan.market.db.mapper.MarketOrderMapper;
import com.cskaoyan.market.db.mapper.MarketUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author yuanixn2158@163.com
 * @since 2023/05/08 15:12
 */
@Service
public class MarketDashBoardServiceImpl implements MarketDashBoardService {
    @Autowired
    private MarketGoodsMapper goodsMapper;
    @Autowired
    private MarketUserMapper userMapper;
    @Autowired
    private MarketGoodsProductMapper goodsProductMapper;
    @Autowired
    private MarketOrderMapper orderMapper;

    @Override
    public Long getGoodsTotal() {
        Long goodsTotal;
        
        
        MarketGoodsExample marketGoodsExample = new MarketGoodsExample();
        return goodsTotal = goodsMapper.countByExample(marketGoodsExample);

    }

    @Override
    public Long getUserTotal() {
        Long userTotal;
        
        
        MarketUserExample marketUserExample = new MarketUserExample();
        return userTotal=userMapper.countByExample(marketUserExample);

    }

    @Override
    public Long getProductTotal() {
        Long productTotal;
        
        
        MarketGoodsProductExample marketGoodsProductExample = new MarketGoodsProductExample();
        return productTotal=goodsProductMapper.countByExample(marketGoodsProductExample);

    }

    @Override
    public Long getOrderTotal() {
        Long orderTotal;
        
        
        MarketOrderExample marketOrderExample = new MarketOrderExample();
        return orderTotal=orderMapper.countByExample(marketOrderExample);

    }


}
